* {
	box-sizing: border-box;
}



/* Verse card header for activity tile */
.verse-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
}
.verse-card-date {
	font-size: 0.95em;
	color: #555;
	font-style: italic;
	flex: 0 0 auto;
}
.verse-card-theme {
	font-size: 0.95em;
	color: #555;
	font-weight: 600;
	flex: 1 1 auto;
	text-align: right;
}


:root {
	--activity-title-sticky-top: 72px;
	--print-page-height: 11in;
	--print-page-margin-y: .2in;
	--print-page-margin-x: .5in;
}

body {
	margin: 0;
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	background: #f7f7f7;
	color: #1f1f1f;
	display: flex;
	flex-direction: column;
}

.page-shell {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1rem;
}

.page-header {
	background: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	padding: 1rem;
	margin-bottom: 1rem;
}

.title {
	margin: 0 0 .5rem;
	font-size: clamp(1.1rem, 4vw, 1.8rem);
}

.directions {
	margin: 0;
	line-height: 1.45;
}

.content-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.setup-panel,
.list-panel {
	background: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	padding: 1rem;
}

label {
	display: block;
	margin: .5rem 0 .35rem;
	font-weight: 600;
}

input[type="text"],
input[type="date"] {
	width: 100%;
	border: 1px solid #cfcfcf;
	border-radius: 8px;
	padding: .6rem .75rem;
	font-size: 0.95rem;
	background: #fff;
}

.selected-verse-box {
	border: 1px solid #d8d8d8;
	border-radius: 10px;
	padding: .8rem;
	margin: .9rem 0;
	background: #fbfbfb;
}

.selected-verse-box h3 {
	margin: 0 0 .5rem;
	font-size: 1rem;
}

.selected-reference {
	margin: 0 0 .5rem;
	font-weight: 600;
}

.selected-passage {
	margin: 0;
	line-height: 1.45;
	color: #353535;
}

.form-row {
	margin-bottom: .75rem;
}
.time-period-options {
	display: flex;
	gap: .75rem;
	flex-wrap: wrap;
	margin-top: .2rem;
}
.time-period-option {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	margin: 0;
	padding: .55rem .8rem;
	border: 1px solid #cfcfcf;
	border-radius: 8px;
	background: #fff;
	font-weight: 500;
	cursor: pointer;
}
.time-period-option input {
	margin: 0;
}

.control-row {
	display: flex;
	gap: .6rem;
	margin: .8rem 0;
	flex-wrap: wrap;
}

.action-buttons {
	margin-top: 1rem;
}

#topActionButtons {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	gap: .6rem;
	flex-wrap: wrap;
	background: transparent;
	padding: .3rem 0;
	margin-top: 0;
}

.top-action-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	flex-wrap: wrap;
	width: 100%;
}

.top-action-row-buttons {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(247, 247, 247, 0.96);
	padding: .45rem 0;
	margin-bottom: 0;
	backdrop-filter: blur(2px);
}

#stickyActionButtons {
	border: 1px solid #d6deef;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
	padding: .5rem .7rem;
	width: 100%;
}

.top-action-field {
	display: flex;
	align-items: center;
	gap: .4rem;
}

.top-action-field label {
	margin: 0;
	font-weight: 600;
	font-size: .9rem;
	white-space: nowrap;
}

#topActionButtons input,
#topActionButtons select {
	width: auto;
	min-width: 128px;
	max-width: 240px;
	margin: 0;
}

#topActionButtons select#defaultVersionSelect {
	min-width: 84px;
	max-width: 84px;
	width: 84px;
	padding-left: .45rem;
	padding-right: .3rem;
}

.activity-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .75rem;
	margin-bottom: 1rem;
}

.dialog-select {
	width: 100%;
	border: 1px solid #cfcfcf;
	border-radius: 8px;
	padding: .6rem .75rem;
	font-size: 0.95rem;
	background: #fff;
}

.activity-tile {
	background: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	padding: .85rem;
}

.activity-tile-title {
	display: flex;
	align-items: center;
	position: sticky;
	top: var(--activity-title-sticky-top);
	z-index: 12;
	margin: 0 0 .45rem;
	color: #1d3f8f;
	background: linear-gradient(180deg, #eef4ff 0%, #dfeafe 100%);
	border: 1px solid #cadcff;
	border-radius: 12px;
	padding: .35rem .5rem .35rem .75rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.activity-tile-name {
	flex: 1;
	text-align: center;
	font-size: clamp(1.05rem, 3.5vw, 1.7rem);
	font-weight: 700;
	letter-spacing: .02em;
}

.btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	font-size: 1.05rem;
	padding: 0;
	border-radius: 8px;
	border: 1px solid transparent;
	background: transparent;
	cursor: pointer;
	color: inherit;
	transition: background .12s ease, color .12s ease;
}

.btn-icon-neutral:hover {
	background: #d7e4ff;
	color: #1d3f8f;
	border-color: #b9cffb;
}

.btn-icon-danger {
	color: inherit;
}

.btn-icon-danger:hover {
	background: #c5342f;
	color: #fff;
	border-color: #c5342f;
}

.btn-icon-primary {
	color: #265cc2;
}

.btn-icon-primary:hover {
	background: #2f6feb;
	color: #fff;
	border-color: #2f6feb;
}

.activity-start-date {
	margin: .45rem 0 .75rem;
	color: #545454;
	font-size: .92rem;
	text-align: center;
	min-height: 1.3rem;
}

.activity-start-date.is-empty {
	visibility: hidden;
}

.activity-tile-actions {
	display: flex;
	justify-content: center;
	gap: .6rem;
	flex-wrap: wrap;
	margin-bottom: .75rem;
}

.activity-verse-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: .65rem;
	margin-top: .75rem;
}

.activity-verse-card {
	border: 1px solid #dadada;
	border-radius: 10px;
	padding: .65rem .65rem .25rem;
	background: #fafafa;
}

.activity-verse-card .control-row {
	margin: .45rem 0 0;
}

.activity-verse-card h4 {
	margin: 0 0 .3rem;
	font-size: .98rem;
}

.activity-verse-content {
	display: flex;
	gap: .75rem;
	align-items: center;
	background: #fafafa;
	border: 1px solid #d6dff5;
	border-radius: 8px;
	padding: 0;
	margin: .35rem 0;
}

.activity-verse-content > p {
	flex: 1;
	min-width: 0;
	margin: 0;
	line-height: 1.45;
	background: #ffffff;
	border: 1px solid #dbe4f7;
	border-radius: 8px;
	padding: .65rem .75rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.activity-verse-qr {
	flex-shrink: 0;
	background: #ffffff;
	border: 1px solid #dbe4f7;
	border-radius: 8px;
	padding: .45rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

/* webpage */
.activity-verse-qr img,
.activity-verse-qr canvas {
	display: block;
	border-radius: 4px;
}

.activity-verse-qr {
	cursor: pointer;
}

.app-toast {
	position: fixed;
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%);
	background: rgba(20, 20, 20, 0.92);
	color: #fff;
	padding: .55rem .8rem;
	border-radius: 10px;
	font-size: .9rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
	z-index: 90;
}

.app-toast.show {
	opacity: 1;
}

.activity-dialog {
	width: min(520px, 92vw);
	border: 1px solid #cecece;
	border-radius: 12px;
	padding: 0;
}

.activity-dialog::backdrop {
	background: rgba(0, 0, 0, .35);
}

.btn {
	border: 1px solid #b7b7b7;
	border-radius: 8px;
	background: linear-gradient(180deg, #f7f7f7 0%, #ececec 100%);
	color: #1f1f1f;
	padding: .55rem .85rem;
	font-size: .94rem;
	cursor: pointer;
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
	transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}

.btn:hover {
	background: linear-gradient(180deg, #f1f1f1 0%, #e4e4e4 100%);
	box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
}

.btn:active {
	transform: translateY(1px);
}

.btn:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.btn-primary {
	background: #2f6feb;
	color: #fff;
	border-color: #2f6feb;
}

.btn-primary:hover {
	background: #265cc2;
}

.btn-accent {
	background: #0c8d4a;
	color: #fff;
	border-color: #0c8d4a;
}

.btn-accent:hover {
	background: #096f3b;
}

.btn-danger {
	background: #c5342f;
	color: #fff;
	border-color: #c5342f;
}

.btn-danger:hover {
	background: #a42925;
}

.status-message {
	min-height: 1.2rem;
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #b8860b;
	text-align: center;
	flex-basis: 100%;
}

.status-message.error {
	color: #b42318;
}

.hidden {
	display: none !important;
}

.verse-selector-dialog {
	width: min(1100px, 95vw);
	border: 1px solid #cecece;
	border-radius: 12px;
	padding: 0;
}

.verse-selector-dialog::backdrop {
	background: rgba(0, 0, 0, .35);
}

.dialog-shell {
	padding: 1rem;
}

.dialog-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: .75rem;
}

.dialog-header h2 {
	margin: 0;
}

.icon-btn {
	border: 1px solid #c8c8c8;
	background: #fff;
	border-radius: 8px;
	width: 2rem;
	height: 2rem;
	cursor: pointer;
}

.step-indicator {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: .4rem 0 1rem;
}

.step-chip {
	border: 1px solid #c8c8c8;
	border-radius: 999px;
	padding: .2rem .65rem;
	font-size: .85rem;
	color: #5b5b5b;
	cursor: pointer;
	user-select: none;
}

.step-chip.active {
	border-color: #2f6feb;
	color: #2f6feb;
	font-weight: 600;
}

.button-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	max-height: 56vh;
	overflow: auto;
	padding-right: .25rem;
}

.book-wrap {
	max-height: 50vh;
}

.chapter-wrap {
	max-height: 52vh;
}

.pick-btn {
	border: 1px solid #c8c8c8;
	background: #fff;
	border-radius: 8px;
	padding: .4rem .65rem;
	cursor: pointer;
}

.pick-btn.selected {
	border-color: #2f6feb;
	background: #eaf1ff;
	font-weight: 600;
}

.testament-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.verse-rows {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	max-height: 52vh;
	overflow: auto;
	padding-right: .25rem;
}

.verse-row {
	border: 1px solid #d3d3d3;
	border-radius: 8px;
	padding: .55rem .65rem;
	background: #fff;
	cursor: pointer;
}

.verse-row .verse-num {
	font-weight: 700;
	margin-right: .3rem;
}

.verse-row.selected {
	border-color: #2f6feb;
	background: #eaf1ff;
}

.dialog-footer {
	margin-top: 1rem;
	display: flex;
	justify-content: space-between;
}

/* Print Preview */
.print-sheet {
	display: none;
	order: -1;
	max-width: 8in;
	margin: 0 auto;
	padding: var(--print-page-margin-y) var(--print-page-margin-x);
	background: #fff;
	border: 1px solid #ddd;
	color: #101010;
	position: relative;
}

@media screen {
	/* dotted line to mark the end of the page */
	.print-sheet::after {
		display: none;
		content: "Page 1 ends here";
		position: absolute;
		left: var(--print-page-margin-x);
		right: var(--print-page-margin-x);
		top: calc(var(--print-page-height) - (var(--print-page-margin-y) * 2));
		border-top: 2px dashed #c5342f;
		padding-top: .15rem;
		font-size: .78rem;
		font-weight: 700;
		color: #c5342f;
		text-align: right;
		pointer-events: none;
	}
}

@page {
	size: letter;
	margin: var(--print-page-margin-y) var(--print-page-margin-x);
}

.print-header {
	text-align: center;
	margin-bottom: 0.8rem;
}

/* Logo image size below Way Cool Bible on the print page */
.print-logo {
	width: 90px;
	height: 90px;
	object-fit: contain;
}

.print-brand-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .75rem;
	margin-bottom: 0.5em;
}

.print-header h1 {
	margin: 0;
	font-size: 1.35rem;
}

/* Way Cool Title for Print Page */
.print-header h1.print-brand {
	font-family: "Cheese", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	font-size: 3rem;
	margin-bottom: .3rem;
}

.print-header p {
	margin: .25rem 0;
}

.print-verse-item {
	/* border-bottom: 3px solid red; */
	/* padding: .5rem 0; */
	margin: .5rem 0;
	break-inside: avoid;
}

/* Verse Metadata: Date and Theme */
.print-verse-meta {
	display: flex;
	justify-content: space-between;
	font-size: .85rem;
	color: #555;
	/* margin-bottom: .55rem; */
}

.print-verse-meta .verse-date,
.print-verse-meta .verse-theme {
	display: inline-block;
}


.print-verse-meta .verse-date {
	font-style: italic;
	/* color: hotpink; */
	padding: 0 1em;
}


.print-verse-meta .verse-theme {
	text-align: right;
	font-weight: 600;
	padding: 0 1em;
}

.print-verse-item .print-verse-reference {
	margin: 0 0 .2rem;
	font-size: 1rem;
}

.print-verse-item .print-verse-passage {
	margin: .2rem 0;
	line-height: 1.35;
}

.print-verse-content {
	display: flex;
	/* gap: .75rem; */
	align-items: flex-start;
	background: #fafafa;
	/* border: 3px solid limegreen;   */
	border: 3px solid black;  
	border-radius: 8px;
	/* margin: 0.5rem 0; */
}

.print-verse-text {
	display: flex;
	flex-direction: column;
	flex: 1;
	/* gap: .3rem; */
	/* border: 3px solid dodgerblue; */
	border-radius: 6px;
	margin: 0.5rem;
	padding: 0.5rem;
	/* padding: .5rem .65rem; */
}

.print-verse-text > .print-verse-reference {
	margin: 0;
	font-size: 0.95rem;
	/* border: 3px solid hotpink; */
	text-decoration: black underline 2px;
}

.print-verse-text > .print-verse-passage {
	flex: 1;
	min-width: 0;
	/* margin: 0.5rem; */
	line-height: 1.45;
	/* background: #ffffff; */
	/* border: 3px solid orange; */
	border-radius: 6px;
	/* padding: .5rem .65rem; */
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
	font-size: 1.05rem;
}

.print-verse-qr {
	flex-shrink: 0;
	background: #ffffff;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
	padding: .35rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.print-verse-qr-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	align-self: center;
	gap: 0;
	/* border: 3px solid blueviolet; */
	border: 3px solid black;
	border-radius: 6px;
	margin: 0.5rem;
	padding: 0.5rem;
}

.print-verse-qr-labels {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.2rem;
}

.print-verse-qr-label {
	font-size: .75rem;
	font-weight: 600;
	color: #555;
}

/* Printout  */
.print-verse-qr img,
.print-verse-qr canvas {
	display: block;
	/* border-radius: 4px; */
}

@media (max-width: 960px) {
	.activity-tiles,
	.content-grid,
	.testament-grid {
		grid-template-columns: 1fr;
	}

	.dialog-footer {
		flex-direction: column;
		gap: .5rem;
	}

	.dialog-footer .btn {
		width: 100%;
	}
}

@media print {
	body {
		background: #fff;
	}

	.no-print,
	dialog {
		display: none !important;
	}

	.print-sheet {
		display: block;
		max-width: none;
		padding: 0;
		border: 0;
	}

	.print-sheet::after {
		display: none;
	}
}

.control-row-small {
	gap: 0.2rem;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
}
.btn-sm {
	font-size: 0.92rem;
	padding: 0.32rem 0.7rem;
	min-width: 32px;
	min-height: 32px;
	border-radius: 0.5rem;
}

/* Mobile Styles */
@media (max-width: 600px) {
	.page-shell {
		padding: 0.3rem;
		max-width: 100vw;
	}
	.page-header {
		padding: 0.7rem 0.5rem;
		margin-bottom: 0.7rem;
		border-radius: 0;
	}
	.title {
		font-size: 1.2rem;
	}
	.directions {
		font-size: 0.98rem;
		padding: 0 0.2rem;
	}
	.activity-tiles {
		grid-template-columns: 1fr;
		gap: 0.5rem;
		margin-bottom: 0.5rem;
	}
	.activity-tile {
		padding: 0.5rem;
		border-radius: 0.7rem;
	}
	.activity-tile-title {
		font-size: 1.1rem;
		padding: 0.3rem 0.4rem;
		border-radius: 0.7rem;
	}
	.activity-tile-name {
		font-size: 1.1rem;
	}
	.activity-verse-list {
		grid-template-columns: 1fr;
		gap: 0.5rem;
	}
	.activity-verse-card {
		padding: 0.5rem 0.3rem 0.2rem;
		border-radius: 0.7rem;
	}
	.activity-verse-card .control-row {
		justify-content: center;
	}
	.activity-verse-content {
		flex-direction: column;
		gap: 0.4rem;
		padding: 0.2rem 0;
	}
	.activity-verse-content > p {
		padding: 0.5rem 0.5rem;
		font-size: 0.98rem;
	}
	.activity-verse-qr {
		padding: 0.2rem;
		margin: 0 auto;
		max-width: 90vw;
	}
	.print-sheet {
		padding: 0.2in 0.1in;
		max-width: 100vw;
		border-radius: 0;
	}
	.print-header {
		margin-bottom: 0.4rem;
	}
	.print-logo {
		width: 60px;
		height: 60px;
	}
	.print-brand-row {
		gap: 0.4rem;
		margin-bottom: 0.2em;
	}
	.print-header h1.print-brand {
		font-size: 1.7rem;
	}
	.print-header h1 {
		font-size: 1rem;
	}
	.print-verse-item {
		margin: 0.3rem 0;
	}
	.print-verse-content {
		flex-direction: column;
		gap: 0.3rem;
		padding: 0.2rem 0;
	}
	.print-verse-text {
		margin: 0.2rem;
		padding: 0.2rem;
	}
	.print-verse-text > .print-verse-passage {
		font-size: 0.98rem;
	}
	.print-verse-qr-wrapper {
		margin: 0.2rem auto;
		padding: 0.2rem;
		border-radius: 0.5rem;
	}
	.dialog-shell {
		padding: 0.5rem;
	}
	.dialog-header {
		padding: 0.2rem 0;
	}
	.dialog-header h2 {
		font-size: 1.1rem;
	}
	.dialog-select, input[type="text"], input[type="date"] {
		font-size: 1rem;
		padding: 0.5rem 0.5rem;
	}

	.btn, .btn-primary, .btn-accent, .btn-danger {
		font-size: 1rem;
		padding: clamp(0.32rem, 2vw, 0.5rem) clamp(0.5rem, 4vw, 0.7rem);
		min-width: 44px;
		min-height: 44px;
		border-radius: 0.7rem;
	}

	.button.btn.btn-primary.btn-sm {
		padding: 0.4rem 0.6rem;
		background-color: purple;
	}

	/* Hide QR code image for verse cards on mobile */
	.activity-verse-qr {
		display: none;
	}
	.control-row {
		gap: 0.3rem;
		flex-direction: column;
		align-items: stretch;
	}

	/* Make verse-tile control-row horizontal on mobile */
	.activity-verse-card .control-row {
		flex-direction: row;
		align-items: center;
	}
	.form-row {
		margin-bottom: 0.5rem;
	}
	.verse-row {
		padding: 0.4rem 0.4rem;
		font-size: 1rem;
	}
	.verse-selector-dialog, .activity-dialog {
		width: 98vw;
		min-width: 0;
		max-width: 100vw;
		border-radius: 0.7rem;
	}
	.step-indicator {
		gap: 0.2rem;
		font-size: 0.95rem;
	}
	.button-wrap {
		gap: 0.2rem;
		max-height: 60vw;
	}
}
